package com.shiwaixiangcun.customer.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shiwaixiangcun.customer.R;
import com.shiwaixiangcun.customer.entity.MerchDetailBean;
import com.shiwaixiangcun.customer.glide.ImageDisplayUtil;
import com.shiwaixiangcun.customer.widget.RoundImageView;

import java.util.List;


/**
 *
 * @author Administrator
 * @date 2016/7/13
 */
public class SurroundDetailAdapter extends BaseQuickAdapter<MerchDetailBean.DataBean.AtlasBean, BaseViewHolder> {

    public SurroundDetailAdapter(@Nullable List<MerchDetailBean.DataBean.AtlasBean> data) {
        super(R.layout.adapter_surround_detail, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, MerchDetailBean.DataBean.AtlasBean item) {

        RoundImageView rIvCover = helper.getView(R.id.riv_cover);
        ImageDisplayUtil.showImageView(mContext, item.getAtlasList().get(0).getAccessUrl(), rIvCover);
        helper.setText(R.id.tv_title, item.getTitle());
        if (item.getPrice() != null) {
            helper.setText(R.id.tv_price, "￥" + item.getPrice());

        }
        if (item.getRemark() != null) {
            helper.setText(R.id.tv_desc, item.getRemark());
        }

    }


}
